import 'package:flutter/material.dart';

class CustomHome extends Widget {
  @override
  Element createElement() {
    return HomeView(this);
  }
}

class HomeView extends ComponentElement {
  HomeView(Widget widget) : super(widget);

  String _text = '1234567890';

  @override
  Widget build() {
    Color primaryColor = Theme.of(this).primaryColor;
    return GestureDetector(
      child: Center(
        child: FlatButton(
          child: Text(_text, style: TextStyle(color: primaryColor),),
          onPressed: () {
            var text = _text.split('')..shuffle();
            _text = text.join();
            markNeedsBuild();
          },
        ),
      ),
    );
  }
}
